Initial changes exploring python3.14 support #118
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem 1
The first problem I ran into when trying to run
rospywith Python 3.14 is that it wouldn't build. I chased down errors and found that it was trying to utilize a different version of python to do the building than the version we wanted to actually run with. I think this just generally creates a lot of potential for compatibility issues.In fact, my version of Ubuntu 22.04 doesn't even have
pythonavailable. I dunno if that was a bug or is part of Python2 being discontinued, but it caused the changed code, when reached, to error. When I manually set it topython3.10I got new kinds of errors related to pip and all that. I think it generally is a bad idea to use Python 3.10 to construct a virtualenv and gather all the dependencies for a Python3.14 project.Instead of calling
pythonby string name, we use the target version of Python, which is passed in fromCMakeLists.txtviaargparse. To do this in a number of functions, we movepythonto the constructor args and make it an instance member.Problem 2
Once I started using this further, I found that there is a further problem with
setuptoolsmissing. This came when trying to depend onlocus_py. I found thatsetuptoolsis no-longer pre-installed in venvs (Changed in version 3.12: setuptools is no longer a core venv dependency.)I hacked away at
venv.pyto installsetuptoolsas part ofpreinstall. Also went to a newer version ofpipandpip-tools. Pretty sure this breaks Python2 support.Problem 3
When depending on
tycho_pyI ran into install failure issues withnumpy. Meson complains:../meson.build:41:12: ERROR: Python dependency not foundI tried updating
numpyintycho_pyrequirements.txtto the latest version:2.3.4and get a version resolution error:Along with log errors before this, I'm pretty sure the issue is that the installer is still using Python 3.10 to build a Python 3.14 virtualenv.
Testing
You can test this with this repo: https://github.com/ablakey/rospypypi/tree/main Though you may have to add additionally complex dependencies to figure out what else is breaking where.